package com.mycompany.webservice.service;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import javax.jws.WebService;

@WebService(endpointInterface = "com.mycompany.webservice.service.InterestRateService")

public
class InterestRateServiceImpl implements InterestRateService {

    List<MortgageType> mortgageTypes = new ArrayList<MortgageType>();

    

    public
float
getInterestRate(MortgageType type, int term) {

        float
rate = 0.0f;


 

        if (type.equals("CLOSED")) {

            if (term == 1) {

                rate = 3.9f;

            } else
if (term > 1 && term < 5) {

                rate = 4.0f;

            } else
if (term >= 5 && term < 10) {

                rate = 4.9f;

            } else
if (term > 10) {

                rate = 5.9f;

            }

        } else
if (type.equals("OPEN")) {

            rate = 6.5f;

        } else
if (type.equals("CONVERT")) {

            rate = 4.9f;

        } else
if (type.equals("CASHBACK")) {

            rate = 6.1f;

        }

        return rate;

    }



	public String getMortgageTypes() {
		
		return "Helooooooooooooooooooooooooooooooo";
	}



	public void addMortgageType(MortgageType type) {
		System.out.println("Helooooooooooooooooooooooooooooooo"); 
		
	}
}
